#pragma once
#include <dsound.h>
#include <string>
#include "dsutil.h"
#include <fstream>
#include "globals.h"

class Sound
{
private:
	LPDIRECTSOUND8    g_pDS;	// The DirectSound Device
	HWND * wndHandle; 
	LPDIRECTSOUNDBUFFER  * SoundChannel; // Creating buffer
	int * ChannelVolume; // pointer to an array of 10 volume values
	int * ChannelPan; // pointer to an array of 10 Pan Values
	int * numberOfSound;
	int  sizeSound;	

public:
	
	Sound();
	~Sound();
	LPDIRECTSOUNDBUFFER LoadWaveToSoundBuffer(std::string wavFilename);
	bool playSound(int bufferID);
	bool playSoundLoop(int bufferID);
	bool stopSound(int bufferID);
	bool initDirectSound(HWND hwnd);
	void shutdownDirectSound(void);
	int countFiles(std::string wavFilename);
	bool LoadSound(std::string wavFilename);
	void initSoundFiles(std::string wavFiles,HWND hwnd);
	void ChangeVolume(int volume, int bufferID);
	void ChangePan(int pan, int bufferID);
	int getSize();
};
